from imports import *
class Enemy(pygame.sprite.Sprite):
##    from imports import *
    def __init__(self,pos, enemy_type="Shyguy"): # pos = (x1, x2, y)
        pygame.sprite.Sprite.__init__(self)
        self.image = image_load(enemy_type + ".gif") # change filenames
        self.rect = self.image.get_rect()
        self.left_limit = int(pos[0])
        self.right_limit = int(pos[1])
        self.ypos = int(pos[2])
        self.dx = 5        
        self.rect.centerx = self.right_limit - 50
        self.rect.bottom = int(self.ypos)
        self.right_boundary = False
        self.left_boundary = False
    def to_write(self): # for adding enemy to file
        return "%d,%d,%d" % (self.left_limit, self.right_limit, self.ypos)
    def update(self):
        self.rect.centerx += self.dx
    def reset(self):
        self.rect.centerx = self.right_limit - 50
        self.rect.bottom = self.ypos
        self.dx = 5
